package com.icloud.common.database.model;

import com.baomidou.mybatisplus.annotation.*;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.*;

import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;

@Getter
@Setter
@Builder
@ApiModel(value = "订单对象", description = "订单表")
@TableName("t_orders")
public class TOrders implements Serializable {
    @ApiModelProperty("主键")
    @EqualsAndHashCode.Include
    @TableId(value="id", type= IdType.ASSIGN_ID)
    private Long id;

    @ApiModelProperty("前台账号 app_customer.id")
    @TableField("customer_id")
    private Long customerId;

    @ApiModelProperty("订单类型")
    @TableField("order_type")
    private String orderType;

    @ApiModelProperty("订单金额")
    @TableField("amount")
    private BigDecimal amount;

    @ApiModelProperty("下单时间")
    @TableField("order_time")
    private LocalDateTime orderTime;

    @ApiModelProperty("支付时间")
    @TableField("payment_time")
    private LocalDateTime paymentTime;

    @ApiModelProperty("取消时间")
    @TableField("cancel_time")
    private LocalDateTime cancelTime;

    @ApiModelProperty("支付状态")
    @TableField("payment_state")
    private String paymentState;

    @ApiModelProperty("状态")
    @TableField("state")
    private String state;

    @ApiModelProperty("创建时间")
    @TableField(value = "created_at", fill = FieldFill.INSERT)
    private LocalDateTime createdAt;

    @ApiModelProperty("修改时间")
    @TableField(value = "updated_at", fill = FieldFill.INSERT_UPDATE)
    private LocalDateTime updatedAt;

    @ApiModelProperty("创建人")
    @TableField(value = "created_id")
    private Long createdId;

    @ApiModelProperty("修改人")
    @TableField(value = "updated_id")
    private Long updatedId;
}
